<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="renderer" content="webkit">
<title><{:C("WEB_TITLE")}></title>
<link rel="shortcut icon" href="favicon.ico">
<link href="/Public/Front/css/bootstrap.min.css" rel="stylesheet">
<link href="/Public/Front/css/font-awesome.min.css" rel="stylesheet">
<link href="/Public/Front/css/animate.css" rel="stylesheet">
<link href="/Public/Front/css/style.css" rel="stylesheet">
<link rel="stylesheet" href="/Public/Front/js/plugins/layui/css/layui.css">
<style>
.layui-form-label {width:110px;padding:4px}
</style>
<body>
<div class="wrapper wrapper-content animated">
    <div class="row">
        <div class="col-sm-12">
            <form class="layui-form" action="" id="payaccess">
                <input type="hidden" name="id" value="<{$pa.id}>">
                <div class="layui-form-item">
                    <label class="layui-form-label">中文名称：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="pa[title]" lay-verify="required" autocomplete="off"
                               value="<{$pa.title}>" placeholder="中文名称" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">英文名称：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="pa[code]" lay-verify="required" placeholder="英文名称" value="<{$pa.code}>"
                               style="text-transform:capitalize;" autocomplete="off" class="layui-input">
                    </div>
                    <div class="layui-form-mid layui-word-aux">注意：即支付接口类名称（不含Controller）</div>
                </div>
                
                <div class="layui-form-item">
                    <label class="layui-form-label">网关地址：</label>
                    <div class="layui-input-block">
                        <input type="text" name="pa[gateway]" placeholder="网关地址" autocomplete="off"
                               value="<{$pa.gateway}>" class="layui-input">
                    </div>
                </div>
                
                <div class="layui-form-item">
                    <label class="layui-form-label">页面通知：</label>
                    <div class="layui-input-block">
                        <input type="text" name="pa[pagereturn]" placeholder="页面通知地址" autocomplete="off"
                               value="<{$pa.pagereturn}>" class="layui-input">
                    </div>
                </div>
                
                <div class="layui-form-item">
                    <label class="layui-form-label">服务器通知：</label>
                    <div class="layui-input-block">
                        <input type="text" name="pa[serverreturn]" placeholder="服务器通知地址" autocomplete="off"
                               value="<{$pa.serverreturn}>" class="layui-input">
                    </div>
                </div>
                
                <div class="layui-form-item">
                    <label class="layui-form-label">运营费率：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="pa[defaultrate]" placeholder="运营费率" autocomplete="off"
                               value="<{$pa.defaultrate}>" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">封顶手续费：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="pa[fengding]" placeholder="封顶手续费" autocomplete="off"
                               value="<{$pa.fengding}>" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">成本费率：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="pa[rate]" placeholder="成本费率" autocomplete="off" value="<{$pa.rate}>"
                               class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">防封域名：</label>
                    <div class="layui-input-block">
                        <input type="text" name="pa[unlockdomain]" placeholder="防封域名" value="<{$pa.unlockdomain}>"
                               autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">分类：</label>
                    <div class="layui-input-inline">
                        <select name="pa[paytype]" lay-verify="required" lay-search="">
                            <option value="">直接选择或搜索选择</option>
                            <volist name="paytypes" id="b">
                                <option
                                <if condition="$pa[paytype] eq $b[id]">selected</if>
                                value="<{$b.id}>"><{$b.name}></option>
                            </volist>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">分流比例：</label>
                    <div class="layui-input-block">
                        <input type="text" name="pa[diversion]" placeholder="入账金额t0 50%,t1 50% 则输入5/5" value="<{$pa.diversion}>"
                               autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">结算类型：</label>
                    <div class="layui-input-inline">
                        <select name="pa[channel_type]" lay-verify="required" lay-search="">
                            <option
                            <if condition="$pa[channel_type] eq 't0'">selected</if>
                            value="t0">T + 0</option>
                            <option
                            <if condition="$pa[channel_type] eq 't1'">selected</if>
                            value="t1">T + 1</option>
                            <option
                            <if condition="$pa[channel_type] eq 'd0'">selected</if>
                            value="d0">D + 0</option>
                            <option
                            <if condition="$pa[channel_type] eq 'd1'">selected</if>
                            value="d1">D + 1</option>
                        </select>
                    </div>
                </div>
                
                
                <div class="layui-form-item">
                    <label class="layui-form-label">状态：</label>
                    <div class="layui-input-block">
                        <input type="radio" name="pa[status]"
                        <if condition="$pa[status] eq 1">checked</if>
                        value="1" title="开启" checked="">
                        <input type="radio" name="pa[status]"
                        <if condition="$pa[status] eq 0">checked</if>
                        value="0" title="关闭">
                    </div>
                </div>
                
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-submit="submit" lay-filter="add">提交保存</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>

    <script src="/Public/Front/js/jquery.min.js"></script>
    <script src="/Public/Front/js/bootstrap.min.js"></script>
    <script src="/Public/Front/js/plugins/peity/jquery.peity.min.js"></script>
    <script src="/Public/Front/js/content.js"></script>
	<script src="/Public/Front/js/plugins/layui/layui.js" charset="utf-8"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script>
layui.use(['layer', 'form'], function(){
  var form = layui.form
  ,layer = layui.layer;
  
  //监听提交
  form.on('submit(add)', function(data){
    $.ajax({
		url:"<{:U('Channel/saveEditSupplier')}>",
		type:"post",
		data:$('#payaccess').serialize(),
		success:function(res){
			if(res.status){
				layer.alert("编辑成功", {icon: 6},function () {
					parent.location.reload();
					var index = parent.layer.getFrameIndex(window.name);
					parent.layer.close(index);
				});
			}else{
                layer.msg("操作失败!", {icon: 5},function () {
                    var index = parent.layer.getFrameIndex(window.name);
                    parent.layer.close(index);
                });
                return false;
            }
		}
	});
    return false;
  });
});
</script>
<!--统计代码，可删除-->
</body>
</html>
